#include <boost/algorithm/string.hpp>
#include <locale>
#include <iostream>

int main()
{
	std::string s = "David Hilbert";

	boost::iterator_range<std::string::iterator> r = boost::algorithm::find_first(s, "David");
	std::cout << r << std::endl; //* operator<< is overloaded for boost::iterator_range

	r = boost::algorithm::find_first(s,"Liang"); //* can't find
	std::cout << r << std::endl;

	r = boost::algorithm::find_last(s,"Hilbert");
	std::cout << r << std::endl;

	r = boost::algorithm::find_nth(s,"David",0);
	std::cout << r << std::endl;

	r = boost::algorithm::find_head(s,5);
	std::cout << r << std::endl;

	r = boost::algorithm::find_tail(s,7);
	std::cout << r << std::endl;
}